class Solution:
    def numWays(self, n: int) -> int:
        if n == 0 or n == 1:
            return 1
        a, b, r = 1, 1, 0
        for i in range(n-1):
            a, b = b, a + b
        else:
            return b%(int(1e9+7))